@using Unity.ClusterDisplay.MissionControl.EngineeringUI.Components

<RadzenStack Orientation="Orientation.Vertical" Style="height: 100%" JustifyContent="JustifyContent.SpaceBetween">
    <RadzenStack Orientation="Orientation.Vertical">
        <RadzenLabel Text="Launchpads" />
        <RadzenDataGrid Data=@Complex.LaunchPads @ref="m_LaunchpadsGrid"
                        SelectionMode="DataGridSelectionMode.Single" @bind-Value=@m_SelectedLaunchPads>
            <Columns>
                <RadzenDataGridColumn TItem="MissionControl.LaunchPad" Title="Name" Property="Name" />
                <RadzenDataGridColumn TItem="MissionControl.LaunchPad" Title="Launchable">
                    <Template Context="launchpad">
                        @{
                            var cfg = GetConfigurationForLaunchPad(launchpad);
                            var effectiveLaunchable = cfg.GetEffectiveLaunchable(Asset, launchpad);
                        }
                        @if (effectiveLaunchable != null)
                        {
                            <span>@effectiveLaunchable.Name</span>
                        }
                        else
                        {
                            <span>(inactive)</span>
                        }
                    </Template>
                </RadzenDataGridColumn>
                <RadzenDataGridColumn TItem="MissionControl.LaunchPad" Width="70px">
                    <Template Context="launchPad">
                        <RadzenButton Click=@(() => ConfigureLaunchPad(launchPad)) Icon="settings" ButtonStyle="ButtonStyle.Light" Class="m-1 data-grid-icon" />
                    </Template>
                </RadzenDataGridColumn>
            </Columns>
        </RadzenDataGrid>
        <RadzenLabel Text="Parameters" />
        <LaunchParameters Parameters=@LaunchParameters Values=@LaunchParametersValue />
    </RadzenStack>    
    <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" class="text-end">
        <RadzenButton Text="Cancel" Click=OnCancel ButtonStyle="ButtonStyle.Light" Style="width: 120px" />
        <RadzenButton Text="OK" Click=OnOk ButtonStyle="ButtonStyle.Info"
                        Style="width: 120px" />
    </RadzenStack>
</RadzenStack>
